package flc.ast.adapter;


import androidx.annotation.NonNull;

import com.chad.library.adapter.base.provider.BaseItemProvider;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import flc.ast.R;
import flc.ast.bean.WishBean;
import stark.common.basic.adaptermutil.StkProviderMultiAdapter;
import stark.common.basic.adaptermutil.StkSingleSpanProvider;

public class WishAdapter extends StkProviderMultiAdapter<WishBean> {

    public WishAdapter() {
        addItemProvider(new StkSingleSpanProvider(126));
        addItemProvider(new WishProvider());
    }

    private class WishProvider extends BaseItemProvider<WishBean> {
        @Override
        public int getItemViewType() {
            return StkProviderMultiAdapter.TYPE_VIEW;
        }

        @Override
        public int getLayoutId() {
            return R.layout.item_wish;
        }

        @Override
        public void convert(@NonNull BaseViewHolder baseViewHolder, WishBean bean) {
            baseViewHolder.setImageResource(R.id.ivWishItemImg, bean.getImg());
            baseViewHolder.setText(R.id.tvWishItemName, bean.getName());
            baseViewHolder.setText(R.id.tvWishItemNum, bean.getNum() + "");
        }
    }

}
